package sctu.edu.java.year2016.team04.luoxinghua.day20160520.charper4_3;

/**用while循环语句计算1+1/2!+1/3！......+1/20!之和
 * Created by 落叶的思恋 on 2016/5/20.
 */

public class whilea{
    public static void main(String[] args) {
        int i=0;
        double s=0,j=1;
        while(i<21){
            i++;
            j=j*i;
            s=s+1/j;
        }
        System.out.println("result is  "+s);
    }
}